/////*
//// * SearchByProductID.java
//// *
//// * Created on March 30, 2007, 2:01 AM
//// *
//// * To change this template, choose Tools | Template Manager
//// * and open the template in the editor.
//// */
////
////package edu.byu.isys413.mystuff.sales;
////
////import edu.byu.isys413.mystuff.Cache;
////import edu.byu.isys413.mystuff.ConnectionPool;
////import edu.byu.isys413.mystuff.ConnectionPoolException;
////import edu.byu.isys413.mystuff.DataException;
////import java.beans.Statement;
////import java.sql.Connection;
////import java.sql.ResultSet;
////import java.sql.SQLException;
////import java.util.ArrayList;
////
/////**
//// *
//// * @author Gabe
//// */
////public class SearchByProductID {
///** This method enables a user to search for a sale by a product ID. This would return a specific sale 
//*if the product is a physical product, but an array of products if the id is for a conceptual product.
//*@param productID contains the product id to be searched by
//*@return an array of SaleBOs that match the product ID criteria.
//*/
//public synchronized ArrayList<RevenueSourceBO> readByProductID(String productID) throws SQLException, DataException, ConnectionPoolException{
//ArrayList<RevenueSourceBO> list = new ArrayList<RevenueSourceBO>();
//
//Connection conn = ConnectionPool.getInstance().get();
//Statement stmt = conn.createStatement();
//ResultSet rs = stmt.executeQuery("SELECT * FROM Sale WHERE ProductID = '" + productID + "'");
//conn.commit();
//
////extract the elements from the result set and build a list of results
////build the object from the result set and add it to the list. (should only return one if the
////productID was for a physical product
//while (rs.next()) {
//SaleBO sale = new SaleBO(rs.getString("RevenueSourceID"));
//Cache.getInstance().put(rs.getString("RevenueSourceID"), sale);
//sale = (SaleBO)super.read(rs.getString("RevenueSourceID"), conn);
//sale.setQuantity(rs.getInt("quantity"));
//list.add(sale);
//}
//return list;
//}
//ConnectionPool.getInstance().release(conn);
